﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.DAL;
using Telerik.Web.UI;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class PR_SalaryEmployee : System.Web.UI.Page
    {
        EmployeeDAL empBll = new EmployeeDAL();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadDataGrid();
            }

        }

        private void LoadDataGrid()
        {
            try
            {
                var ds =  empBll.LoadEmployeesLite();
                RadGrid2.DataSource = ds;
                RadGrid2.DataBind();
            }
            catch (Exception ex)
            {

            }
        }

        protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Sort" || e.CommandName == "Filter")
            {
                LoadDataGrid();
            }
            if (e.CommandName == "ExpandCollapse")
            {
                return;

            }
            LoadDataGrid();
        }
    }
}